{extend name="public/base"/}
{block name="body"}
<div class="main-box no-header clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
		<div class="pull-right">
			<a href="javascript:;" data-toggle="modal" data-target="#myModal" class="btn btn-primary pull-right"> <i class="fa fa-plus-circle fa-lg"></i> 导入数据</a>
		</div>
	</header>
	<div class="main-box-body clearfix">
		<div class="table-responsive">
      <div class="row">
  			<form method="get">
  				<div class="col-sm-12 col-md-4 col-lg-3">
  					<input type="text" class="form-control" name="keyword" value="" placeholder="请输入关键字">
  				</div>
  								<div class="col-sm-12 col-md-4">
  					<button class="btn btn-primary" type="submit">搜索</button>
  				</div>
  			</form>
  		</div>
      <table class="table table-striped table-hover">
        <thead>
          <tr>
            <th width="30"><input class="checkbox check-all" type="checkbox"></th>
            <th width="60">ID</th>
            <th>智慧记订单号</th>
            <th>智慧记名称</th>
            <th>微信名</th>
            <th>添加积分</th>
            <th>状态</th>
          </tr>
        </thead>
        <tbody>
          {volist name="list" id="item"}
          <tr>
            <td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$item['id']}"></td>
            <td>{$item['id']}</td>
						<td>{$item['order_number']}</td>
            <td>
              {$item['name']}
            </td>
            <td>

							{$item['w_id']|get_table_field="id","nickname","WxUser"}
            </td>
            <td>
              {$item['integral']}
            </td>
            <td>
              {$item['status'] ? '添加成功': '添加失败,未绑定微信账号'}

            </td>
          </tr>
          {/volist}

        </tbody>
      </table>
      {$list->render()}
		</div>
	</div>
</div>

<!-- Modal -->
<div class="modal fade "  id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">导入数据</h4>
      </div>

			<FORM method="post" enctype="multipart/form-data" class="form-horizontal" action="{:url('import')}">

			<INPUT type="file" class="file" name="file" style="padding: 30px;"><br/>

				<div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
          <button type="submit" class="btn btn-primary submit-btn "  target-form="form-horizontal">导入</button>
        </div>
			</FORM>

    </div>
  </div>
</div>


{/block}

{block name="script"}
<script type="text/javascript" src="__PUBLIC__/js/bootstrap-editable.min.js"></script>
<script type="text/javascript">
$(function(){
	$.fn.editable.defaults.mode = 'popup';
	$.fn.editableform.buttons = '<button type="submit" class="btn btn-success editable-submit btn-mini"><i class="fa fa-check-square-o fa-white"></i></button>' +
	'<button type="button" class="btn editable-cancel btn-mini"><i class="fa fa-times"></i></button>';
	$('.editable').editable();
})
</script>
{/block}
